#!/bin/sh
set -eu
runtime_dir="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
export DCP_SQUARE_RUBY="$runtime_dir/bin/ruby"
export GEM_HOME="$runtime_dir/lib/ruby/gems/3.4.0"
export GEM_PATH="$GEM_HOME"
export RUBYLIB="$runtime_dir/lib/ruby/3.4.0"
for native_dir in "$runtime_dir/lib/ruby/3.4.0"/arm64-darwin*; do
  if [ -d "$native_dir" ]; then
    RUBYLIB="$native_dir:$RUBYLIB"
  fi
done
export RUBYLIB
exec "$runtime_dir/bin/ruby-runtime" -EUTF-8:UTF-8 "$@"
